﻿@{
    WebSecurity.RequireAuthenticatedUser();
    Layout = "~/_SiteLayout.cshtml";
    Page.Title = "CASH CARD SEARCH";
    Page.Region = RefDataManager.GetRegionLkUpVal();
    Page.IDType = RefDataManager.GetIDTypeLkUpVal();
    Page.Solicitor = RefDataManager.GetSolicitorLkUpVal();
    Page.CustClass = RefDataManager.GetCustClassLkUpVal();
    Page.PartnerBank = RefDataManager.GetPartnerBankLkUpVal();
    
    
}
<style type="text/css">
 *{ font-family: Verdana; font-size: 96%; }
label { width: 15em; float: left; }
label.error { float: none; color: red; padding-left: .5em; vertical-align: top; }
p { clear: both; }
.submit { margin-left: 12em; }
em { font-weight: bold; padding-right: 1em; vertical-align: top; }
</style>
<script>
     $(function(){
        wireEvents();
    });
    
  function wireEvents(){
    $("#dpSearch").datepicker({
          changeMonth:true,
          changeYear:true,
          showButtonPanel:true,
          dateformat:'dd/mm/yy',
          yearRange:'-100:+0',
          minDate: new Date(1930,1-1,1),
          maxDate: new Date(2012,12-1,31)
        });
    
        GetLookUp("#region","#country","country");
        GetLookUp("#country","#state","state");
        
        $("#search").click(function(){
           loadGrid();
         });
        
         $("#results" ).tabs();
        $("#button2").children().button();
        
        showSpinner();
}  
function getCC(){
    
}

function loadGrid(){
    var sol = $("#solicitor").val();
    var custClass = $("#custClass").val();
    var pbank = $("#pb").val();
    var country = $("#country").val();
    var state = $("#state").val();;
    var action = $("#extType").val();
    var region =$("#region").val();
    
    var params = (sol!="none")?"?solicitor="+sol:"?solicitor=0";
    params+=(custClass!="none")?"&custClass="+custClass:"&custClass=0";
    params+=(pbank!="none")?"&pbank="+pbank:"&pbank=0";
    params+=(region!="none")?"&region="+region:"&region=0";
    params+=(country!="")?"&country="+country:"&country=0";
    params+=(state!="")?"&state="+state:"&state=0";
    
    
    var dummy = new Date().getTime();
    $.get("/CashCard/ExtractCCGrid/"+action+params+"&dummy="+dummy,function(data){
        $("#grid").html(data); 
    });
    
   /* $("#grid").empty();
    $("#grid").load("/CashCard/ExtractCCGrid/"+action+params);*/
}
   
    
</script>
<style>
    .layout{
        float:left;
        margin:1em;
    }
</style>
<form method="post" id="custSearchForm">
    <div id="spinner" class="spinnerContent" style="display:none;border:1px solid black">
                    <img id="img-spinner" src="@Href("/images/ajax-loader.gif")" alt="Loading"/>
                    <p>Searching cash cards please wait...</p>
                </div>
                <div id="spinnerBG"></div>
    
   
    <div>
         <fieldset class="ui-widget ui-widget-content">
        <legend>Search Parameters</legend>
        <div class="layout">    
        <p>
           <label for="extType">EXTRACTION TYPE</label></p> 
                          <p><select name="extTyp" id="extType">
            <option value="printing">Card Printing</option>
            <option value="activation">Activation</option>
            <option value="delivery">Delivery</option>
         </select> 
        </p>
        </div>
         <div class="layout">      
        <p>
        <label for="custClass">CLASSIFICATIOIN</label></p>
         <p><select name="custClass" id="custClass">
         <option value="none"></option>
        @foreach(var c in Page.CustClass){
            <option value="@c.RefID">@c.RefDesc</option>
        }
        
    </select>         
        </p>
        </div>
        <div class="layout">       
        <p> <label for="solicitor">SOLICITOR</label></p>
        <p> <select name="solicitor" id="solicitor">
        <option value="none"></option>
        @foreach(var s in Page.Solicitor){
            <option value="@s.RefID">@s.RefDesc</option>
        }
        
    </select>  
        </p>
        </div>
        <div class="layout">
            <p>
        <label for="pb">PARTNER BANK</label></p>
              <p><select name="pb" id="pb">
                        <option value="none"></option>
                      @foreach(var pb in Page.PartnerBank){
            <option value="@pb.RefID">@pb.RefDesc</option>
        }
                    </select>
        </p>    
        </div>
         <div class="layout">      
        <p>
        <label for="region">REGION:</label></p>
            <p><select name="region" id="region">
         <option value="none"></option>
        @foreach(var region in Page.Region){
            <option value="@region.RefID">@region.RefDesc</option>
        } 
          </select>
        </p>
        </div>
         <div class="layout">      
        <p>
        <label for="country">COUNTRY:</label></p>
               <p><select name="country" id="country">
       <option value=""></option>
        
    </select>
        </p>
        </div>
         <div class="layout">      
        <p>
         <label for="state">STATE:</label></p>   
             <p><select name="state" id="state">
       <option value=""></option>
        
    </select>
        </p>    
       </div>
               
            </fieldset>     
   
     
       
            
       
        
 
        
    
    <div id="buttons">
        <input type="button" id="search" value="search"/>
        <input type="button" id="clear" value="clear"/>
        
    </div>
    <br/>
   <div id="grid">
    
</div>
   
</form>

